package com.itheima;



import com.itheima.Spring.SpringApplicationContext;
import com.itheima.domain.User;
import com.itheima.service.UserService;

import static java.lang.System.*;

public class App {
    public static void main(String[] args) {
        //1.创建核心类对象  关联核心配置文件
        SpringApplicationContext context = new SpringApplicationContext("beans.xml");
        //2.从IOC 容器中获取OrderService对象
        UserService service = (UserService) context.getBean("userService");
        //3.使用接口调用方法
        //根据订单ID查询订单信息并把结果打印到控制台
        User user = service.findUser();
        out.println("user = " + user);
    }
}

